\section{Why Python?}

\centeredlargetext{white}{black}{
Why use Python?
}


\begin{frame}
\frametitle{Open Source Research}
\begin{itemize}
  \item Sharing code and data is often overlooked but is as important as sharing algorithms and results in published scientific research.
  \item Shared code promotes reproducible research and scientific validation.
  \item Computer vision research code is commonly written in MATLAB.
  \item Sharing research code written in MATLAB is a good first step, but \ldots
  \item MATLAB code can only be executed by a privileged few who can afford MATLAB license fees.
\end{itemize}
\end{frame}


\begin{frame}
\frametitle{Why not MATLAB?}
\begin{itemize}
\item Language design
  \begin{itemize}
  \item MATLAB is effective for quick code and/or small code bases,\\
        but does not scale as projects grow
  \item Numerical computing is easy, but more general programing is not
  \end{itemize}
\item Top-level functions and code organization
  \begin{itemize}
  \item Function-name = file-name in MATLAB:\\ discourages writing
    modular programs
  \item Hard to appropriately name functions and organize code without conflicts
  \end{itemize}
\item Toolboxes are purchased separately
  \begin{itemize}
  \item Shared MATLAB code will only run if you've licensed the right toolboxes
  \end{itemize}
\item Cost -- Very Expensive!
\end{itemize}
\end{frame}


\begin{frame}
\frametitle{MATLAB Pricing}
\reference{
More Info: \url{http://www.mathworks.com/store/productIndexLink.do}
}
\begin{center}
\begin{tabular}{l|l}
\textbf{MATLAB Component} & \textbf{Price} \\
\hline\hline
Inidvidual Matlab License & \$2,150 \\
MATLAB Compiler           & \$5,000 \\
Toolboxes                 & \\
\hspace{1em} Computer Vision System    & \$1,350 \\
\hspace{1em} Image Processing          & \$1,000 \\
\hspace{1em} Optimization              & \$1,000 \\
\hspace{1em} Parallel Computing        & \$1,000 \\
\hspace{1em} Statistics                & \$1,000 \\
\hspace{1em} Neural Network            & \$1,000 \\
\hspace{1em} Signal Processing         & \$1,000 \\
\hspace{1em} Symbolic Math             & \$1,000 \\
\hline
\textbf{Total}            & \$15,500 \emph{per user}\\
\end{tabular}
\end{center}
\begin{itemize}
  \item Pricing as of April 12th, 2012.
\end{itemize}
\end{frame}


\begin{frame}
\frametitle{Open Source Alternatives to MATLAB}
\begin{itemize}
\item \href{http://www.gnu.org/software/octave/}{Octave} (GPL license)
\begin{itemize}
\item A mostly MATLAB compatible language
\item Command line only (no GUI IDE)
\end{itemize}
\item \href{http://freemat.sourceforge.net/}{FreeMat} (GPL license)
\begin{itemize}
\item A somewhat MATLAB compatible language
\item Very basic GUI
\end{itemize}
\item \href{http://www.scilab.org/}{Scilab} (CeCILL license)
\begin{itemize}
\item Not compatible with MATLAB language, provides a converter
\item Most full featured IDE
\end{itemize}
\pause
\vspace{0.5cm}
\item These options solve the cost and license restrictions, but have the same technical limitations MATLAB.
\item None of these options are perfectly compatible with MATLAB code.
\item Each has a relatively small user community.
\end{itemize}
\end{frame}


\begin{frame}
\frametitle{Why Python?}
\reference{
Interesting essay: \url{http://www.stat.washington.edu/~hoytak/blog/whypython.html}
}
\begin{itemize}
\item Cost / License
  \begin{itemize}
  \item Python and related packages are free (have no licensing fee)
  \item Python and related packages use permissive BSD-like licenses.
  \end{itemize}
\item Language design
  \begin{itemize}
  \item Python has well-designed language features supporting small
    and large code bases
  \item Python code is highly readable
  \end{itemize}
\item Top-level functions and code organization
  \begin{itemize}
  \item Python is modular and supports name spaces to avoid naming conflicts.
  \end{itemize}
\item Integration with other languages/tools
\item An enormous user base.
  \begin{itemize}
  \item Python is used for just about everything (web, database, networking, GUI, gaming, graphics, science, \ldots)
  \end{itemize}
\item Just search the web for testimonials
\end{itemize}
\end{frame}


\begin{frame}
\frametitle{Ways to Use Python: Many IDE Choices}
\reference{
\href{http://en.wikipedia.org/wiki/List_of_integrated_development_environments_for_Python}
     {\nolinkurl{http://en.wikipedia.org/wiki/List_of_integrated_devel...for_Python}}
}
\begin{center}
\includegraphics[width=\textwidth]{ScreenShot/wikipedia-ide-table}
\end{center}
\begin{itemize}
  \item There are several choices for Python development environments.
  \item The above list is from Wikipedia (taken April 2012).
  \item Spyder is most like the MATLAB IDE.
\end{itemize}
\end{frame}


\begin{frame}
\frametitle{Ways to Use Python: IDLE Python IDE}
\reference{
More info: \url{http://docs.python.org/library/idle.html}
}
\begin{columns}[t]
\column{0.4\textwidth}
\centering
\includegraphics[width=\textwidth]{ScreenShot/idle-editor}\\
\column{0.465\textwidth}
\centering
\includegraphics[width=\textwidth]{ScreenShot/idle-shell}\\
\end{columns}
\begin{itemize}
  \item The original IDE, bundled with most Python installations.
  \item IDLE is simple and not very intuitive to use.
\end{itemize}
\end{frame}


\begin{frame}
\frametitle{Ways to Use Python: IPython Qt Console}
\overlayicon{Icons/ipython}
\reference{
More info: \url{http://ipython.org/}
}
\begin{center}
\includegraphics[width=0.6\textwidth]{ScreenShot/ipython-inline}
\end{center}
\begin{itemize}
\item IPython Qt Console allows for inline plotting.
\item We will use IPython Qt Console to learn the basics of Python.
\end{itemize}
\end{frame}


\begin{frame}
\frametitle{Ways to Use Python: SymPy with IPython Notebook}
\overlayicon{Icons/ipython}
\reference{
More info: \url{http://ipython.org/} and \url{http://sympy.org/}
}
\begin{center}
\includegraphics[width=0.65\textwidth]{ScreenShot/ipython-notebook}
\end{center}
\begin{itemize}
\item IPython Notebook lets you keep a math notebook in a web browser.
\item SimPy adds symbolic math for a Maple or Mathematica alternative.
\item Run \texttt{ipython notebook --profile=sympy}
\end{itemize}
\vspace{1em}
\end{frame}


\begin{frame}
\frametitle{Ways to Use Python: Spyder IDE}
\overlayicon{Icons/spyder}
\reference{
More info: \url{http://code.google.com/p/spyderlib/}
}
\begin{center}
\includegraphics[width=0.8\textwidth]{ScreenShot/spyder}
\end{center}
\begin{itemize}
\item Spyder provides an IDE similar to MATLAB.
\item We will use Spyder later in this tutorial.
\end{itemize}
\vspace{1em}
\end{frame}